﻿<sap:ActivityDesigner x:Class="BioWF.Activities.Design.NCBIBlastDesigner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:converters="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
    xmlns:bio="clr-namespace:Bio;assembly=Bio"
    xmlns:extensions="clr-namespace:BioWF.Activities.Design.Extensions"
    xmlns:collections="clr-namespace:System.Collections.Generic;assembly=mscorlib">
    <sap:ActivityDesigner.Icon>
        <DrawingBrush>
            <DrawingBrush.Drawing>
                <ImageDrawing>
                    <ImageDrawing.Rect>
                        <Rect Location="0,0" Size="16,16" ></Rect>
                    </ImageDrawing.Rect>
                    <ImageDrawing.ImageSource>
                        <BitmapImage UriSource="Images/ncbi_blast.png" />
                    </ImageDrawing.ImageSource>
                </ImageDrawing>
            </DrawingBrush.Drawing>
        </DrawingBrush>
    </sap:ActivityDesigner.Icon>

    <StackPanel>
        <StackPanel.Resources>
            <converters:ArgumentToExpressionConverter x:Key="argToExpression" />
            <Style TargetType="TextBlock">
                <Setter Property="FontWeight" Value="Bold" />
                <Setter Property="Margin" Value="5" />
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>
        </StackPanel.Resources>

        <TextBlock Text="Sequences" />
        <sapv:ExpressionTextBox Margin="5" 
                                OwnerActivity="{Binding ModelItem}"
                                HintText="List of sequences to BLAST"
                                Expression="{Binding ModelItem.Sequences, Mode=TwoWay, Converter={StaticResource argToExpression}, ConverterParameter=In}">
            <sapv:ExpressionTextBox.ExpressionType>
                <extensions:Generic BaseType="{x:Type collections:IEnumerable`1}"
                                InnerType="{x:Type bio:ISequence}" />
            </sapv:ExpressionTextBox.ExpressionType>
        </sapv:ExpressionTextBox>
     
        <TextBlock Text="Program" />
        <sapv:ExpressionTextBox Margin="5" 
                                OwnerActivity="{Binding ModelItem}"
                                ExpressionType="system:String"
                                HintText="Program to use (blastn)"
                                Expression="{Binding ModelItem.Program, Mode=TwoWay, Converter={StaticResource argToExpression}, ConverterParameter=In}" />
        <TextBlock Text="Database" />
        <sapv:ExpressionTextBox Margin="5" 
                                OwnerActivity="{Binding ModelItem}"
                                ExpressionType="system:String"
                                HintText="Database to search (nr)"
                                Expression="{Binding ModelItem.Database, Mode=TwoWay, Converter={StaticResource argToExpression}, ConverterParameter=In}" />
        
        <CheckBox Margin="5" Content="Use Browser Proxy" IsChecked="{Binding ModelItem.UseBrowserProxy}" />

    </StackPanel>
</sap:ActivityDesigner>
